
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>登录</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style" />
	<meta content="telephone=no" name="format-detection" />
	<link rel="shortcut icon" href="/favicon.ico">
	<link href="/static/app/css/login.css" rel="stylesheet" type="text/css" />
    <script>
    !function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var o=e.split(".");2==o.length&&(t=t[o[0]],e=o[1]),t[e]=function(){t.push([e].concat(Array.prototype.slice.call(arguments,0)))}}(p=t.createElement("script")).type="text/javascript",p.async=!0,p.src=s.api_host+"/static/array.js",(r=t.getElementsByTagName("script")[0]).parentNode.insertBefore(p,r);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var e="posthog";return"posthog"!==a&&(e+="."+a),t||(e+=" (stub)"),e},u.people.toString=function(){return u.toString(1)+".people (stub)"},o="capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags".split(" "),n=0;n<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
    posthog.init('phc_YbILrRYZIl1t07oBWTdspsTkGUFCVebFGrvfMxtkdU4',{api_host:'https://app.posthog.com'})
</script>
</head>
<body>

<section class="aui-flexView">
	<header class="aui-navBar aui-navBar-fixed">
		<a href="javascript:;" class="aui-navBar-item">
			<!-- <i class="icon icon-return"></i> -->
		</a>
		<div class="aui-center">
			<span class="aui-center-title"></span>
		</div>
		<a href="javascript:;" class="aui-navBar-item" >
		</a>
	</header>
	<section class="aui-scrollView">
		<div class="aui-ver-head">
			<img src="/static/app/images/head.png" alt="">
		</div>
		<div class="aui-ver-form">
			<h2>短信快捷登录</h2>
			<div class="aui-flex">
				<div class="aui-flex-box">
					<i class="icon icon-phone"></i>
					<input id="phone1" type="text" autocomplete="off" placeholder="手机号码" >
				</div>
			</div>
			<div class="aui-flex">
				<div class="aui-flex-box">
					<i class="icon icon-code"></i>
					<input id="code1" type="text" autocomplete="off" placeholder="验证码">
				</div>
				<div class="aui-button-code">
					<input id="btnSendCode1" type="button" class="btn btn-default" value="获取验证码" />
				</div>
			</div>
			<div class="aui-ver-button">
				<button id="login">立即登录 / 注册</button>
			</div>
			<div class="aui-cell-box">
				<label class="cell-right">
					<input id="cell-right-checkbox" type="checkbox" value="1" name="checkbox" checked="checked">
					<i class="cell-checkbox-icon"></i>
					<em>同意扣扣网注册协议</em>
				</label>
			</div>

		</div>
		<div class="aui-login-box">
			<h2>其它登录方式</h2>
		</div>
		<div class="aui-palace">
			<a href="javascript:;" class="aui-palace-grid">
				<div class="aui-palace-grid-icon">
					<img src="/static/app/images/icon-sc1.png" alt="">
				</div>
				<div class="aui-palace-grid-text">
					<h2>微信</h2>
				</div>
			</a>
			<a href="javascript:;" class="aui-palace-grid">
				<div class="aui-palace-grid-icon">
					<img src="/static/app/images/icon-sc2.png" alt="">
				</div>
				<div class="aui-palace-grid-text">
					<h2>淘宝</h2>
				</div>
			</a>
			<a href="javascript:;" class="aui-palace-grid">
				<div class="aui-palace-grid-icon">
					<img src="/static/app/images/icon-sc3.png" alt="">
				</div>
				<div class="aui-palace-grid-text">
					<h2>腾讯</h2>
				</div>
			</a>
			<a href="javascript:;" class="aui-palace-grid">
				<div class="aui-palace-grid-icon">
					<img src="/static/app/images/icon-sc4.png" alt="">
				</div>
				<div class="aui-palace-grid-text">
					<h2>微博</h2>
				</div>
			</a>
		</div>

	</section>
</section>
</body>
<script src="/static/app/js/jquery.min.js"></script>
<script type="text/javascript">
	var phoneReg = /^(13[0-9]|14[5|7]|15[0|1|2|3|4|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
	var count = 60;
	var InterValObj1;
	var curCount1;

	$("#btnSendCode1").click(sendMessage1)
	function sendMessage1() {
		curCount1 = count;
		var phone = $.trim($('#phone1').val());
		console.log(phone)
		if (!phoneReg.test(phone)) {
			alert(" 请输入有效的手机号码");
			return false;
		}

		$("#btnSendCode1").attr("disabled", "true");
		$("#btnSendCode1").val( + curCount1 + "秒再获取");
		InterValObj1 = window.setInterval(SetRemainTime1, 1000);

	}
	function SetRemainTime1() {
		if (curCount1 == 0) {
			window.clearInterval(InterValObj1);
			$("#btnSendCode1").removeAttr("disabled");
			$("#btnSendCode1").val("重新发送");
		}
		else {
			curCount1--;
			$("#btnSendCode1").val( + curCount1 + "秒再获取");
		}
	}

	$("#login").click(binding)
	function binding(){
		var phone = $.trim($('#phone1').val());
		//var status = phoneReg.test(phone)
		// if(!status){
		// 	alert("手机号码格式错误！")
		// }

		var code = $.trim($('#code1').val());

		if (phone == "" || code == ""){
			alert("必填信息不能为空！")
			return
		}
		if(!$("#cell-right-checkbox").is(':checked')){
			alert("先同意注册协议！")
			return
		}
		$.ajax({
            type: 'post',
            url: '/login.html',
            data: "username="+phone+"&password="+code,
            //dataType: 'json',
            success: responce => {
                //login.text('登录')
                let code = responce.code
                let msg = responce.msg
                if(code == 200){	//登录成功
                    //取消登录按钮不可点击
                    //login.attr("disabled", false);
                    // setTimeout(()=>{
                    //     message({icon: 'success', content: msg,})
                    // },timeout)
                    window.location.href = "/";
                }else{
                    // login.attr("disabled", false);
                    // setTimeout(()=>{
                    //     message({icon: 'error', content: msg,})
                    // },timeout)
					alert("账号或者密码错误！")
                }
            },
        })
		
	}

</script>

</html>
